import { getRiskInfo } from '@/api/customer'
const customer = {
  state: {
    riskData: []
  },
  mutations: {
    SET_RISKDATA: (state, riskData) => {
      state.riskData = riskData
    }
  },
  actions: {

    // 获取客户信息
    RiskGetInfo({ commit }) {
      return new Promise((resolve, reject) => {
        console.log('RiskGetInfo')
        getRiskInfo().then(response => {
          console.log('getInfo')
          const data = response.data
          commit('SET_RISKDATA', data)
          console.log(data)
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default customer
